from django.db import models

from utils.base_models import BaseModel


class Interface(BaseModel):
    id = models.AutoField(verbose_name='id主键', primary_key=True, help_text='id主键')
    name = models.CharField('接口名称', max_length=200, unique=True, help_text='接口名称')
    project_id = models.CharField('所属项目id',  max_length=50, help_text='所属项目id')
    project_name = models.CharField('所属项目名', max_length=50, help_text='所属项目名')
    module_id = models.CharField('所属模块id', max_length=50, help_text='所属模块id')
    module_name = models.CharField('所属模块名', max_length=50, help_text='所属模块名')
    author = models.CharField('编写人员', max_length=50, default='刘翔', help_text='编写人员')
    request = models.TextField('请求信息', help_text='请求信息')

    class Meta:
        # 定义表名
        db_table = 'lx_interface'
        verbose_name = '接口信息'
        verbose_name_plural = verbose_name

    def __str__(self):
        return self.name



